There is a technology, in which only when a current peak value is large, such as upon starting, a gate resistance upon turn-off is increased such that a turn-off fall time of a switching element is extended, thereby reducing a surge voltage (e.g., see JP-A-2007-143230). In JP-A-2007-143230, the gate resistance upon turn-off is increased in a case of conditions such as upon starting, so that a surge voltage of a drain-to-source voltage VDS of the switching element is limited. Therefore, this is effective in the case of a quasi-resonant control, in which the drain-to-source voltage VDS of the switching element is likely to be increased.